package leetcode;

public class AdapterStrategy {
	public static void main(String[] args){
		EnglishSpeaker engMan = new Ghostt();
		Translater translater = new Translater(engMan);
		translater.speakChinese();
	}
}

interface EnglishSpeaker{
	public String speakEnglish();
}

interface ChineseSpeaker{
	public void speakChinese();
}

class Ghostt implements EnglishSpeaker{
	
	@Override
	public String speakEnglish() {
		return "I speak English";
	}
	
}
class Translater implements ChineseSpeaker{
	private EnglishSpeaker englishSpeaker = null;
	public Translater(EnglishSpeaker englishSpeaker) {
		this.englishSpeaker = englishSpeaker;
	}
	private String translater(String eng){
		return "I speak Chinese";
	}
	@Override
	public void speakChinese() {
		System.out.println(translater(this.englishSpeaker.speakEnglish()));
	}
	
}